@echo off

for /f "tokens=2 delims=," %%i in ('title @@@^&tasklist /v /fo csv /nh /fi "windowtitle eq @@@"') do set pcs=%%~i
rem PPID
rem set pcs=%ERRORLEVEL%

%JAVA_HOME%\bin\java %* -p %pcs%

exit %ERRORLEVEL%
